#ifndef LOCKCTRL_H
#define LOCKCTRL_H

#include <QObject>
#include <QStringList>
#if QT_VERSION > 0x50000
#include <QSerialPort>
#include <QSerialPortInfo>
#else
#include "Qextserial/qextserialport.h"
#endif

class LockCtrl : public QObject
{
    Q_OBJECT
public:
    explicit LockCtrl(QObject *parent = NULL);
    void initCom(QString devName, int baudRate);
    void writeData(QByteArray qba);
    void openLock(int cascadeNum, int ioNum);
#if QT_VERSION > 0x50000
    QStringList getDevList();
#endif

private:
#if QT_VERSION > 0x50000
    QSerialPort* mycom;
#else
    QextSerialPort* mycom;
#endif

private slots:
    void recvComData();

signals:
    void openDevRst(bool);

public slots:
};

#endif // LOCKCTRL_H
